@import './var.less';
@item-width: 80px;
@item-height: 80px;
@icon-color: #dcdee0;

.v-form__upload {
  .v-form__upload-preview {
    display: flex;
    flex-wrap: wrap;
  }

  .van-uploader__preview-delete {
    background: none;
  }

  .v-form__upload-preview-item {
    position: relative;
    z-index: 1;
    width: @item-width;
    height: @item-height;
    margin: 0 10px 10px 0;

    img {
      max-width: 100%;
      max-height: 100%;
      border-radius: @border-radius;
    }
  }

  .v-form__upload-preview-text {
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .v-form__upload-preview-mask {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background-color: @mask-color;
    border-radius: @border-radius;
    color: #fff;
  }

  .v-form__upload-loading-text {
    margin-top: 5px;
    font-size: 12px;
  }

  // 上传按钮
  .v-form__upload-input {
    position: relative;
    z-index: 1;
    width: @item-width;
    height: @item-height;
    background-color: @background-color;
    border-radius: @border-radius;

    input {
      width: 100%;
      height: 100%;
      opacity: 0;
    }

    .van-icon {
      position: absolute;
      top: 50%;
      left: 50%;
      z-index: -1;
      font-size: 24px;
      color: @icon-color;
      transform: translate(-50%, -50%);
    }
  }
}
